{include file='comdir/head.html'}
<body>
<div class="content">
    <div class="animated fadeInDown">
        <div class="pos"><a href="#" onClick="javascript :history.back(-1);">返回上一页</a></div>
        <div class="btn-box">
            <button class="btn btn-sm btn-success linkclassadd">添加</button>
        </div>
        <div class="table_list_wrap">
            <div class="table-responsive">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>分类名称</th>
                        <th>描述</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody class="listtbody">
                    {foreach from=$list item=vo}
                    <tr class="linkclass_{$vo.classid}">
                       
                        <td>{$vo.classname}</td>
                        <td>{$vo.description}</td>
                        <td>{$vo.addtime|date_format:'%Y-%m-%d %H:%M:%S'}</td>
                        <td>
                            <input type="button" onclick="edit({$vo.classid})" class="btn btn-xs btn-warning" value="编辑">
                            <input type="button" onclick="del({$vo.classid})" class="btn btn-xs btn-danger" value="删除">
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div class="page-box">
        <div class="page">
            {if $list}
            {$pageshow}
            {/if}
        </div>
    </div>
</div>
</div>
<script type="text/javascript">
    var _URL='{$_URL}';
    {literal}
    $(function(){
        $('.linkclassadd').click(function(){
            window.location.href=_URL+"Link/classadd";
        })
    })
    function edit(id){
        window.location.href=_URL+"Link/classedit?id="+id;
    }
    function del(id){
        var url=_URL+"Link/classdel";
        var del_all=layer.confirm('确认要删除吗！', {btn: ['确认','取消'],'title':'站点'},function(){
            _ajaxs.post(url,'classid='+id,function(data){
                layer.msg(data.msg,{icon: 1}, function(){});
                if(data.status){
                    $('.linkclass_'+id).remove();
                }
                layer.close(index);
            })
        });
    }
    function ajaxpage(page){
        url='';
        url+="page="+page;
        _ajaxs.post(_URL+"Link/classlists",url,function _return(data){
            $('.listtbody').html('');
            $('.listtbody').html(data.data.list);
            if(data.data.pageshow){
                $('.page').html(data.data.pageshow);
            }else{
                $('.page').html('');
            }
        },'json')
    }
    {/literal}
</script>

</body>
</html>